home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / boosters.arc / WAIT.PAS < prev    next >
Pascal/Delphi Source File  |  1985-11-03  |  700b  |  25 lines

  1. { --------------------------------------
  2.   WAIT for Timer to elapse or a KeyPress.
  3.   If KeyPress was HOME key, WAIT waits
  4.   for another KeyPress.
  5.   -------------------------------------- }
  6. Procedure Wait ( NumberOfSeconds : Integer);
  7. begin
  8.    repeat until Timer(NumberOfSeconds) or KeyPressed;
  9.    if KeyPressed then
  10.    begin
  11.       read(Kbd,ch);
  12.       StartElapsed := FALSE;
  13.       if (ch = #27) and KeyPressed then
  14.       begin
  15.          read(Kbd,ch);
  16.          if ch = #71 then
  17.          begin
  18.             repeat until KeyPressed;
  19.             read(Kbd,ch);
  20.             if (ch = #27 ) and KeyPressed then
  21.                read(Kbd,ch);
  22.          end;
  23.       end;
  24.    end;
  25. end { Wait };